<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("member.view")}</title>
<link href="${base}/resources/shop/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.tools.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<style type="text/css">
.stores label {
	width: 150px;
	display: block;
	float: left;
	padding-right: 6px;
}
</style>
</head>
<body>
	<div class="pathh">
		${message("member.view")}
	</div>
	<form id="inputForm">
	<ul id="tab" class="tab">
		<li>
			<input type="button" value="${message("common.base")}" />
		</li>
		[#if memberAttributes?has_content]
			<li>
				<input type="button" value="${message("member.profile")}" />
			</li>
		[/#if]
		<li>
			<input type="button" value="${message("member.storeInfo")}" />
		</li>
	</ul>
	<table class="input tabContent">
		<tr>
			<th>
				${message("member.username")}:
			</th>
			<td>
				${store_member.member.username}
			</td>
		</tr>
		<tr>
			<th>
				${message("member.memberRank")}:
			</th>
			<td>
				${store_member.memberRank.name}
			</td>
		</tr>
		<tr>
			<th>
				${message("member.status")}:
			</th>
			<td>
				[#if !store_member.isEnabled]
					<span class="red">${message("member.disabled")}</span>
				[#elseif store_member.member.isLocked]
					<span class="red"> ${message("member.locked")} </span>
				[#else]
					<span class="green">${message("member.normal")}</span>
				[/#if]
				[#if store_member.isPartner]<span class="green">合伙人</span>[#else]消费者[/#if]
			</td>
		</tr>
		<tr id ="pc_tr"  [#if !store_member.isPartner] style="display: none" [/#if]>
			<th>
				${message("member.partnerCategory")}:
			</th>
			<td>
				[#if store_member.partnerCategory??]${store_member.partnerCategory.name}[/#if]
			</td>
		</tr>
		<tr id ="parent_tr" [#if !store_member.isPartner] style="display: none" [/#if]>
			<th>
				${message("member.recommend")}:
			</th>
			<td >
				[#if store_member.recommend??]${store_member.recommend.username + "["+ store_member.recommend.mobile +"]"}[/#if]
			</td>
		</tr>
		[#if store_member.member.isLocked]
			<tr>
				<th>
					${message("member.lockedDate")}:
				</th>
				<td>
					${store_member.member.lockedDate?string("yyyy-MM-dd HH:mm:ss")}
				</td>
			</tr>
		[/#if]
		<tr>
			<th>
				${message("member.point")}:
			</th>
			<td>
				${store_member.point}
			</td>
		</tr>
		<tr>
			<th>
				${message("member.balance")}:
			</th>
			<td>
				${currency(store_member.balance, true)}
			</td>
		</tr>
		
		[#if store_member.member.memberType == "salesman"]
		<tr>
			<th>
				${message("member.policyAmt")}:
			</th>
			<td>
				${currency((store_member.policyAmt)!0, true)}
			</td>
		</tr>
		[/#if]
		<tr>
			<th>
				${message("common.createDate")}:
			</th>
			<td>
				${store_member.createDate?string("yyyy-MM-dd HH:mm:ss")}
			</td>
		</tr>
		<tr>
			<th>
				${message("member.loginDate")}:
			</th>
			<td>
				${(store_member.member.loginDate?string("yyyy-MM-dd HH:mm:ss"))!"-"}
			</td>
		</tr>
	</table>
	[#if memberAttributes?has_content]
		<table class="input tabContent">
			[#list memberAttributes as memberAttribute]
				<tr>
					<th>
						${memberAttribute.name}:
					</th>
					<td>
						[#if memberAttribute.type == "name"]
							${store_member.member.name}
						[#elseif memberAttribute.type == "gender"]
							[#if store_member.member.gender??]${message("Member.Gender." + store_member.member.gender)}[/#if]
						[#elseif memberAttribute.type == "birth"]
							${store_member.member.birth}
						[#elseif memberAttribute.type == "area"]
							[#if member.area??]
								${store_member.member.area}
							[#else]
								${store_member.member.areaName}
							[/#if]
						[#elseif memberAttribute.type == "address"]
							${store_member.member.address}
						[#elseif memberAttribute.type == "zipCode"]
							${store_member.member.zipCode}
						[#elseif memberAttribute.type == "phone"]
							${store_member.member.phone}
						[#elseif memberAttribute.type == "mobile"]
							${store_member.member.mobile}
						[#elseif memberAttribute.type == "text"]
							${store_member.member.getAttributeValue(memberAttribute)}
						[#elseif memberAttribute.type == "select"]
							${store_member.member.getAttributeValue(memberAttribute)}
						[#elseif memberAttribute.type == "checkbox"]
							[#list store_member.member.getAttributeValue(memberAttribute) as option]
								${option}
							[/#list]
						[/#if]
					</td>
				</tr>
			[/#list]
		</table>
	[/#if]
	<table class="input tabContent">
		<tr>
			<th>
				${message("member.saleOrg")}:
			</th>
			<td  width="500px">
				${saleOrg.name}
			</td>
		</tr>
		<tr class="stores">
			<th>
				${message("member.store")}:
			</th>
			<td>
				<span class="fieldSet">
					[#list allStores as store]
						[#if store.type == "store"]
							<label>
								${store.name}
							</label>
						[/#if]
					[/#list]
				</span>
			</td>
		</tr>
	</table>
	<table class="input">
		<tr>
			<th>
				&nbsp;
			</th>
			<td>
				<input type="button" class="button" value="${message("common.back")}" onclick="location.href='list.jhtml'" />
			</td>
		</tr>
	</table>
	</form>
</body>
</html>